Skip to content

Add Rehydrate, Enhancement for UI Tables and APIs - #2950

Merged
mareklibra merged 2 commits into
redhat-developer:mainfrom
asmasarw:feature/rehydrate
Apr 30, 2026
Merged

Add Rehydrate, Enhancement for UI Tables and APIs#2950
mareklibra merged 2 commits into
redhat-developer:mainfrom
asmasarw:feature/rehydrate

Conversation

@asmasarw

@asmasarw asmasarw commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Fixes Applied here:

  • Removing RBAC Sidebar menu is it's No Longer Needed.
  • Resource Tab - Modify Base URL with Read-Only (GET)
  • Adding Rehydrate Button with new Endpoint for CatalogInstanceItem
  • Fixing Empty Rows Gap Jira Ticket
  • Fixing Persist Page size per Tab Jira Ticket

@rhdh-gh-app

rhdh-gh-app Bot commented Apr 29, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/dcm/packages/app none v0.0.1
@red-hat-developer-hub/backstage-plugin-dcm-common workspaces/dcm/plugins/dcm-common minor v1.0.0
@red-hat-developer-hub/backstage-plugin-dcm workspaces/dcm/plugins/dcm minor v1.0.0

@asmasarw
asmasarw force-pushed the feature/rehydrate branch from c2a8f79 to 4283a4b Compare April 29, 2026 11:01
@asmasarw asmasarw changed the title Add Rehydrate, Remove Resources Tab and RBAC Sidebar menu Add Rehydrate, Fix UI Paginations Bugs Apr 29, 2026
@asmasarw asmasarw changed the title Add Rehydrate, Fix UI Paginations Bugs Add Rehydrate, Enhancement for UI Tables and APIs Apr 29, 2026
@asmasarw
asmasarw force-pushed the feature/rehydrate branch 2 times, most recently from 921a331 to 57804d4 Compare April 30, 2026 07:04
@asmasarw
asmasarw force-pushed the feature/rehydrate branch from f224067 to 1450e57 Compare April 30, 2026 07:22
@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.28662% with 133 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c9312e8). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2950   +/-   ##
=======================================
  Coverage        ?   32.85%           
=======================================
  Files           ?       92           
  Lines           ?     1960           
  Branches        ?      471           
=======================================
  Hits            ?      644           
  Misses          ?     1265           
  Partials        ?       51           
Flag Coverage Δ
dcm 32.85% <15.28%> (?)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9312e8...0e73523. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mareklibra mareklibra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks.
The important comment is about error propagation.

),
width: '120px',
render: inst => {
const busy = rehydratingId === (inst.uid ?? '');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't following effectively the same?

Suggested change
const busy = rehydratingId === (inst.uid ?? '');
const busy = rehydratingId === inst.uid;

): Promise<CatalogItemInstance> {
return this.fetch<CatalogItemInstance>(
`catalog-item-instances/${catalogItemInstanceId}:rehydrate`,
{ method: 'POST' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Content-Type: application/json is set but body is missing.
Is it intentional? At least {} is a good practice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, API is not expecting any body.
But It's a good approach to send an empty {} Object.

resourcesApi
.listServiceTypeInstances()
.then(res => setInstances(res.instances ?? []))
.catch(() => setInstances([]))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This silently swallows potential error.
It must be rendered for the user.

const handleRehydrate = useCallback(
async (inst: CatalogItemInstance) => {
const id = inst.uid ?? '';
if (!id) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how the interface has been created.
Can you verify, that the uuid must be set as optional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UUID is Optional because During Creation, we do not generate any ID for the Catalog item Instance.
UUID is generated after creating in server side (Backend).

import { Box, Chip, IconButton, Tooltip, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles(() => ({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move that behind the imports? It's a little but messy this way...

@sonarqubecloud

Copy link
Copy Markdown

@asmasarw
asmasarw requested a review from mareklibra April 30, 2026 10:20
@mareklibra
mareklibra merged commit e3985a8 into redhat-developer:main Apr 30, 2026
61 checks passed
lokanandaprabhu pushed a commit to lokanandaprabhu/rhdh-plugins that referenced this pull request May 14, 2026
)

* Add Rehydrate, Remove Resources Tab and RBAC Sidebar menu

* Show Error to User, add Default Empty Body...
@asmasarw
asmasarw deleted the feature/rehydrate branch June 22, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants